home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Sunday Times: The Month 2003 December
/
The Sunday Times - The Month 2003-12.iso
/
mac
/
The Month DEC 03
/
engine
/
modules
/
preview_nofade.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2003-09-05
|
2KB
|
91 lines
function loadImage(mc, node, extrapath)
{
extrapath != null ? 0 : (extrapath = "");
var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
var strImg = node.getText();
var diffpath = node.attributes.path;
if(diffpath != null)
{
strImg = diffpath + strImg;
}
else
{
strImg = strDefaultPath + extrapath + strImg;
}
strPathPrefix != null ? 0 : (strPathPrefix = "");
mc.loadMovie(strPathPrefix + strImg);
}
function init()
{
nmCurrentImage = 0;
PREVIEW_PATH = nodeData.attributes.imagepath;
var mc_image;
var mc_file;
var strFile;
len = nmImagesTotal = nodeData.childNodes.length;
var n = 0;
while(n < len)
{
mc_image = this.createEmptyMovieClip("mc_image_" + n,++depth);
mc_image._visible = false;
mc_file = mc_image.createEmptyMovieClip("mc_file",++depth);
strFile = nodeData.childNodes[n].byName("image").getText();
mc_file.onLoad = fileLoaded;
loadImage(mc_file,nodeData.childNodes[n].byName("image"),PREVIEW_PATH);
n++;
}
mc_image = this.createEmptyMovieClip("mc_image_" + len,++depth);
mc_image._visible = false;
mc_file = mc_image.createEmptyMovieClip("mc_file",++depth);
mc_file.onLoad = fileLoaded;
nmCurrentImage = len;
loadImage(mc_file,_parent.ndDefault.byName("image"),PREVIEW_PATH);
}
function exit()
{
delete mc_front;
delete mc_back;
this.removeAllMovieClips();
}
function doOver(num)
{
default_image = this["mc_image_" + len];
default_image._visible = false;
showCurrentImage(num);
}
function doOut()
{
mc_image = this["mc_image_" + len];
mc_image._visible = true;
current_image = this["mc_image_" + nmCurrentImage];
current_image._visible = false;
}
function showCurrentImage(nextnum)
{
nmCurrentImage = nextnum;
mc_back = this["mc_image_" + nmCurrentImage];
mc_back._visible = true;
}
function fileLoaded()
{
this.onLoad = null;
nmImagesLoaded++;
if(nmImagesLoaded == nmImagesTotal)
{
allImagesLoaded();
}
}
function allImagesLoaded()
{
this["mc_image_" + len]._visible = true;
onComplete();
}
nmImagesLoaded = 0;
depth = 0;
this.onReady();
this.onUnload = function()
{
clearFadeDelay();
mc_front.onEnterFrame = null;
};